package util;


import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;

public class chinese extends HttpServlet implements Filter {

	public void doFilter(ServletRequest re, ServletResponse rs,
			FilterChain fc) throws IOException, ServletException {
		re.setCharacterEncoding("utf-8");
		rs.setCharacterEncoding("utf-8");
		rs.setContentType("text/html; charset=utf-8");
		fc.doFilter(re, rs);

	}

	public void init(FilterConfig fc) throws ServletException {
		fc.getInitParameter("encoding");
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
	}

}
